<template>
  <view>
    <!-- 菜单区 -->
    <view class="cm-picker-head-menu cm-flex cm-flex-j-between cm-flex-a-center"
      :class="[ colNamesNum === 0 ? 'app-border-color_ex-bottom' : '' ]">
      <cm-button cm-class="app-text-color-grey-imp" outlined :border="false" @click="leftClickhHandler">返回</cm-button>
      <slot></slot>
      <cm-button type="primary" outlined :border="false" @click="rightClickHandler">确定</cm-button>
    </view>
    
    <!-- 表头列名 -->
    <view class="cm-picker-head-names cm-flex cm-text-12 cm-text-center"
      v-if="colNamesNum !== 0"
      :class="[ colNamesNum !== 0 ? 'app-border-color_ex-bottom' : '' ]">
      <view v-for="(item, index) in colNames" :key="index"
        :style="{ width: (100 / colNamesNum) + '%' }">{{ item }}</view>
    </view>
  </view>
</template>

<script src="./cm-picker-head.js"></script>

<style lang="stylus">
@import './cm-picker-head.styl'
</style>
